/*
 Navicat Premium Data Transfer

 Source Server         : snow
 Source Server Type    : MySQL
 Source Server Version : 80300 (8.3.0)
 Source Host           : localhost:3306
 Source Schema         : cjl_flow

 Target Server Type    : MySQL
 Target Server Version : 80300 (8.3.0)
 File Encoding         : 65001

 Date: 16/06/2025 17:00:59
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for oauth_access_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_access_token`;
CREATE TABLE `oauth_access_token` (
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `token_id` varchar(255) DEFAULT NULL,
  `token` blob,
  `authentication_id` varchar(255) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `client_id` varchar(255) DEFAULT NULL,
  `authentication` blob,
  `refresh_token` varchar(255) DEFAULT NULL,
  UNIQUE KEY `authentication_id` (`authentication_id`),
  KEY `token_id_index` (`token_id`),
  KEY `authentication_id_index` (`authentication_id`),
  KEY `user_name_index` (`user_name`),
  KEY `client_id_index` (`client_id`),
  KEY `refresh_token_index` (`refresh_token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of oauth_access_token
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for oauth_client_details
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_details`;
CREATE TABLE `oauth_client_details` (
  `client_id` varchar(255) NOT NULL,
  `resource_ids` varchar(255) DEFAULT NULL,
  `client_secret` varchar(255) DEFAULT NULL,
  `scope` varchar(255) DEFAULT NULL,
  `authorized_grant_types` varchar(255) DEFAULT NULL,
  `web_server_redirect_uri` varchar(255) DEFAULT NULL,
  `authorities` varchar(255) DEFAULT NULL,
  `access_token_validity` int DEFAULT NULL,
  `refresh_token_validity` int DEFAULT NULL,
  `additional_information` text,
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `archived` tinyint(1) DEFAULT '0',
  `trusted` tinyint(1) DEFAULT '0',
  `autoapprove` varchar(255) DEFAULT 'false',
  PRIMARY KEY (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of oauth_client_details
-- ----------------------------
BEGIN;
INSERT INTO `oauth_client_details` (`client_id`, `resource_ids`, `client_secret`, `scope`, `authorized_grant_types`, `web_server_redirect_uri`, `authorities`, `access_token_validity`, `refresh_token_validity`, `additional_information`, `create_time`, `archived`, `trusted`, `autoapprove`) VALUES ('app', NULL, '$2a$10$kMaVqg3/ogjJGRhJV5idh.a7wKcXCdFXV7pGSY8QPF6g/RWF2lRpS', 'all', 'password,refresh_token,authorization_code', 'http://localhost:8080/callback', NULL, NULL, NULL, NULL, '2021-11-09 15:53:07', 0, 0, 'true');
COMMIT;

-- ----------------------------
-- Table structure for oauth_code
-- ----------------------------
DROP TABLE IF EXISTS `oauth_code`;
CREATE TABLE `oauth_code` (
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `code` varchar(255) DEFAULT NULL,
  `authentication` blob,
  KEY `code_index` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of oauth_code
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for oauth_refresh_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_refresh_token`;
CREATE TABLE `oauth_refresh_token` (
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `token_id` varchar(255) DEFAULT NULL,
  `token` blob,
  `authentication` blob,
  KEY `token_id_index` (`token_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of oauth_refresh_token
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `role_name` varchar(255) NOT NULL COMMENT '角色名称',
  `role_memo` varchar(255) NOT NULL COMMENT '角色关系 以ROLE_开头',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COMMENT='角色表';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` (`id`, `role_name`, `role_memo`) VALUES (1, 'LANDLORD', '房东');
INSERT INTO `sys_role` (`id`, `role_name`, `role_memo`) VALUES (2, 'ADMIN', '管理员');
INSERT INTO `sys_role` (`id`, `role_name`, `role_memo`) VALUES (3, 'COMPANY', '企业');
INSERT INTO `sys_role` (`id`, `role_name`, `role_memo`) VALUES (4, 'POLICE', '社区民警');
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '用户名/手机号',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `real_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '用户名称',
  `is_enable` int NOT NULL COMMENT '是否可用 true为账号正常',
  `is_lock` int NOT NULL COMMENT '是否锁定 true为账号正常',
  `is_expired` int NOT NULL COMMENT '是否过期 true为账号正常',
  `is_credentials` int NOT NULL COMMENT '是否认证 true为账号正常',
  `createtime` date NOT NULL COMMENT '创建时间',
  `logintime` date DEFAULT NULL COMMENT '登录时间',
  `only_one` int DEFAULT NULL COMMENT '是否只可一个账号在线',
  `dept_id` int DEFAULT NULL COMMENT '归属部门 多个逗号隔开',
  `img_url` varchar(255) DEFAULT NULL COMMENT '头像地址',
  `user_status` smallint NOT NULL DEFAULT '1' COMMENT '账号状态1正常2禁用',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8mb3 COMMENT='用户表';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (2, 'ls', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', '管理员', 1, 1, 1, 1, '2021-11-07', '2021-11-07', 1, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (4, 'www', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2021-11-19', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (5, 'wzk', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2021-11-19', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (6, 'device', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', '卡卡西', 1, 1, 1, 1, '2021-11-19', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (8, 'testt', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-11-21', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (9, 'test123', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-11-21', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (10, 'test1223', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-11-21', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (11, 'test13', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-11-21', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (15, 'ceshi222', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-11-24', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (18, 'ceshi3', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-11-24', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (19, 'ygy', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-11-24', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (20, 'zs', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-11-29', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (25, 'ew', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-12-07', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (26, 'fe', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-12-07', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (27, 'few', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-12-07', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (30, 'gre', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2022-12-07', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (42, 'sysadmin', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2023-02-14', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (61, 'dddd', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 1, 1, '2023-02-14', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (62, 'songxue', '$2a$10$F8Qpj57Wr/d/qe8LVdcndeXDtYlxibN5CQRDc8E26lYpHRwcBwmy2', NULL, 1, 1, 2, 2, '2023-05-17', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (63, 'wangkaijun', '$2a$10$4ka6oWAmW.d.mhHvr/VAiu74mlIbtmb/WDq/pD43JjfvDr0FBrlGS', NULL, 1, 1, 1, 1, '2025-02-11', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (64, 'sss', '$2a$10$W5OU29Osx0z5prQjBKXCI.FNocH/3izvUi5d3hOK8uzF.el2L4saK', NULL, 1, 1, 1, 1, '2025-02-11', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (65, 'ceshi001', '$2a$10$ZS4QedJdrKff9w3..vhrdOOUJKXEIRVklUCbCYWZdK/w2hUTeAhYS', NULL, 1, 1, 1, 1, '2025-05-12', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (66, 'ceshi086', '$2a$10$moOYV4Y9ib7sspOlpcSVBu66Wkdds86UlJQMPlvVZFMef8133LBW6', NULL, 1, 1, 1, 1, '2025-05-12', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (67, 'ceshi087', '$2a$10$Y9Of/H9QVzcokUsams4uNOKI50TQf/P3S96T6HMnRlQ7WZTH48dCO', NULL, 1, 1, 1, 1, '2025-05-12', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (68, 'ceshi088', '$2a$10$l8tDDyog4xiaRcwwMxciIuF/heLD7O8DcbGgYDf/AMju7268tFs0y', NULL, 1, 1, 1, 1, '2025-05-12', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (69, 'ceshi089', '$2a$10$wZ7Os94n/pG20SJzg0VUOuj6.aL5.FSjYo/RedeXY53kIFueK/oWC', NULL, 1, 1, 1, 1, '2025-05-12', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (70, 'ceshi099', '$2a$10$09Jl89uUWg.rjN/bv9VJOeiUK1s7CXgjnGRuKD5J6QdOXVICXcIHS', NULL, 1, 1, 1, 1, '2025-05-16', NULL, NULL, NULL, NULL, 1);
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `is_enable`, `is_lock`, `is_expired`, `is_credentials`, `createtime`, `logintime`, `only_one`, `dept_id`, `img_url`, `user_status`) VALUES (71, 'ceshi100', '$2a$10$J4oJTFYqMe7slL8/rLb.xeKW42mNeV78R/Z/VS3K8S.D7tPWC2nca', NULL, 1, 1, 1, 1, '2025-05-16', NULL, NULL, NULL, NULL, 1);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL COMMENT '用户id',
  `role_id` int NOT NULL COMMENT '角色id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COMMENT='用户对应角色表';

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (1, 1, 1);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (2, 2, 2);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (3, 3, 3);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (4, 69, 1);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (5, 70, 2);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (6, 71, 1);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
